﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Administrator/Administrator.Master" CodeBehind="ElencoNews.aspx.vb" Inherits="TecnoHouse.ElencoNewsAdmin" %>
<%@ Register Assembly="Trirand.Web" Namespace="Trirand.Web.UI.WebControls" TagPrefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link rel="Stylesheet" type="text/css" href="/GUI/css/ui.jqgrid.css" />
    <script type="text/javascript" src="/GUI/js/grid.locale-it.js"></script>
    <script type="text/javascript" src="/GUI/js/jquery.jqGrid.min.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="mainContent" runat="server">
    <h1>Gestione News</h1>
    <div id="toolbar">
        <a id="btnaggiungi" href="/Administrator/DettaglioNews.aspx" class="fg-button fg-button-icon-left ui-state-default ui-corner-all">
           <span class="ui-icon ui-icon-plusthick"></span>nuovo</a>
        <a id="btnmodifica" href="#" class="fg-button fg-button-icon-left ui-state-default ui-corner-all">
           <span class="ui-icon ui-icon-pencil"></span>modifica</a>
        <a id="btnelimina" href="#" class="fg-button fg-button-icon-left ui-state-default ui-corner-all">
           <span class="ui-icon ui-icon-trash"></span>elimina</a>
    </div>
    <div class="clearer"></div>
    <cc1:JQGrid ID="GRD_News" runat="server" Width="600px">
        <Columns>
            <cc1:JQGridColumn DataField="ID" Visible="false" PrimaryKey="true" />
            <cc1:JQGridColumn DataField="Titolo" HeaderText="Titolo" Width="250" />
            <cc1:JQGridColumn DataField="DataPubblicazione" HeaderText="Data Pubblicazione"  />
            <cc1:JQGridColumn DataField="DataScadenza" HeaderText="Data Scadenza" />
        </Columns>
        <ToolBarSettings ShowRefreshButton="true" ShowSearchButton="true" />
        <ClientSideEvents RowSelect="onRowSelect"  />
        <AppearanceSettings ShowRowNumbers="true" HighlightRowsOnHover="true" />
        <SearchDialogSettings MultipleSearch="true" />
    </cc1:JQGrid>
    <script type="text/javascript">
        function onRowSelect(id) {
            $("#btnmodifica").attr("href", "/Administrator/DettaglioNews.aspx?id=" + id);
        }

        $(function() {
            $("#btnelimina").click(function() {
                var grid = $("#<%=GRD_News.ClientID %>");
                var rowKey = grid.getGridParam("selrow");
                if (rowKey) {
                    grid.delGridRow(rowKey, grid.delDialogOptions);
                }
                else {
                    $("#dialog").html("Selezionare un elemento").dialog("open");
                }
            });
        });
    </script>

</asp:Content>
